import VueI18n from 'vue-i18n'
import { URL } from "url";
import Vue from 'vue'
import messages from './i18n.js'
Vue.use(VueI18n)

const myURL = new URL(location.href);
const locale = myURL.searchParams.get("lang") 
const lang = navigator.language.toLowerCase() 
document.documentElement.lang = locale || lang || "zh-cn";

export default new VueI18n({
  locale: document.documentElement.lang,
  messages
})
